比較兩個檔案的差異是很常會遇到的事情,要在 VS Code 做這件事很簡單。 在左側的 Explorer 先對第一個檔案按右鍵,選擇「選取用以比較」,然後再對第二個檔案按右鍵,選擇「與選取的比較」。 這樣就可以看到以第一個檔案為基底,跟第二個檔案的差異。 在編輯器沒分割的情況下,差異會以兩欄呈現,左邊是第一個檔案,右邊是第二個檔案。 有分割則會在同一欄顯示差異: VS Code 也可以對同一個檔案的歷史狀態比較差異。 在左下角有一格「時間表(timeline)」,裡面記錄著對檔案的修改,如果有使用 Git
WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.